package com.huowenjie.controller;

import com.huowenjie.api.TestApi;
import com.huowenjie.entity.Dan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class DanController {

    @Autowired
    TestApi testApi;

    @RequestMapping("list")
    public List<Dan> list(){
        List<Dan> list = testApi.list();
        return list;
    }

}
